﻿//新增现场销售
var fnAddOrder = function () {
    if (fkey != '00000000-0000-0000-0000-000000000000') {
        document.getElementById("EditUIWindow").src = "../Crm/MeetingArrange/AddCrmLiveSale.aspx?productId=" + fkey + "&r=" + Math.random() + "&entity=V_CrmLiveOrDerManager";
        var pagetitle = "新增现场销售";
        parent.$("#tabs").tabs('close', pagetitle);
        parent.addTabs(pagetitle, "../Crm/MeetingArrange/AddCrmLiveSale.aspx?productId=" + fkey + "&r=" + Math.random() + "&entity=V_CrmLiveOrDerManager&title=" + encodeURI(pagetitle) + "");
    }
    else {
        alert('请先选择产品');
    }

}
//修改现场销售
var fnOrderModify = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var pagetitle = '修改现场销售';
    var productId = record.getData("CourseLayoutID");
    parent.$("#tabs").tabs('close', pagetitle); ;
    parent.addTabs(pagetitle, "../Crm/MeetingArrange/AddCrmLiveSale.aspx?r=" + Math.random() + "&entity=V_CrmLiveOrDerManager&title=" + encodeURI(pagetitle) + "&productId=" + productId + "&id=" + record.getData(const_entityID));
    parent.NeedRefreshPage = this;
}
//自动义双击方法
function CustomDbClick() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var pagetitle = '修改现场销售';
    var productId = record.getData("CourseLayoutID");
    parent.$("#tabs").tabs('close', pagetitle); ;
    parent.addTabs(pagetitle, "../Crm/MeetingArrange/AddCrmLiveSale.aspx?r=" + Math.random() + "&entity=V_CrmLiveOrDerManager&title=" + encodeURI(pagetitle) + "&productId=" + productId + "&id=" + record.getData(const_entityID));
    parent.NeedRefreshPage = this;
}
